package com.hsxc.cdz.monitor.bean.pile.v1_33;

import com.hsxc.cdz.base.util.BytesUtil;

/**
 * 
 * @author 陈钊 
 * @versionV1.33
 * 充电桩主动上送的账单报文实体类
 *
 */
public class BillPileMsg extends PileMessage {

	private String startTime; // 充电开始时间
	private String endTime; // 充电结束时间
	private String cardNum; // 用户卡号
	private int startRecord; // 充电前电表读数
	private int endRecord; // 充电后电表读数
	private int electricity; // 充电电量
	private int sumMoney; // 充电费用
	private int startCardMon; // 充电开始前卡上余额
	private int endCardMon; // 充电后卡上余额
	private int serviceMon; // 服务费金额
	private String lineNum;// 原流水号
	private int isPay; // 是否支付 1 已支付 0 未支付
	private int stopReason;// 充电结束原因
	private int startWay;// 充电启动方式
	private int controll;// 控制类型
	private int limitData;// 限制数据
	private String identiNum;// 车辆识别码 arscII类型

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		this.cardNum = cardNum;
	}

	public int getStartRecord() {
		return startRecord;
	}

	public void setStartRecord(int startRecord) {
		this.startRecord = startRecord;
	}

	public int getEndRecord() {
		return endRecord;
	}

	public void setEndRecord(int endRecord) {
		this.endRecord = endRecord;
	}

	public int getElectricity() {
		return electricity;
	}

	public void setElectricity(int electricity) {
		this.electricity = electricity;
	}

	public int getSumMoney() {
		return sumMoney;
	}

	public void setSumMoney(int sumMoney) {
		this.sumMoney = sumMoney;
	}

	public int getStartCardMon() {
		return startCardMon;
	}

	public void setStartCardMon(int startCardMon) {
		this.startCardMon = startCardMon;
	}

	public int getEndCardMon() {
		return endCardMon;
	}

	public void setEndCardMon(int endCardMon) {
		this.endCardMon = endCardMon;
	}

	public int getserviceMon() {
		return serviceMon;
	}

	public void setserviceMon(int serviceMon) {
		this.serviceMon = serviceMon;
	}

	public int getIsPay() {
		return isPay;
	}

	public void setIsPay(int isPay) {
		this.isPay = isPay;
	}

	public int getServiceMon() {
		return serviceMon;
	}

	public void setServiceMon(int serviceMon) {
		this.serviceMon = serviceMon;
	}

	public String getLineNum() {
		return lineNum;
	}

	public void setLineNum(String lineNum) {
		this.lineNum = lineNum;
	}

	public int getStopReason() {
		return stopReason;
	}

	public void setStopReason(int stopReason) {
		this.stopReason = stopReason;
	}

	public int getStartWay() {
		return startWay;
	}

	public void setStartWay(int startWay) {
		this.startWay = startWay;
	}

	public int getControll() {
		return controll;
	}

	public void setControll(int controll) {
		this.controll = controll;
	}

	public int getLimitData() {
		return limitData;
	}

	public void setLimitData(int limitData) {
		this.limitData = limitData;
	}

	public String getIdentiNum() {
		return identiNum;
	}

	public void setIdentiNum(String identiNum) {
		this.identiNum = identiNum;
	}

	@Override
	public void getContentFromByte(byte[] data) {
		byte[] temp;

		temp = BytesUtil.getByte(0, 7, data);
		this.setStartTime(BytesUtil.bcdBytesToStr(temp));

		temp = BytesUtil.getByte(7, 7, data);
		this.setEndTime(BytesUtil.bcdBytesToStr(temp));

		temp = BytesUtil.getByte(14, 10, data);
		this.setCardNum(BytesUtil.bcdBytesToStr(temp));

		temp = BytesUtil.getByte(24, 4, data);
		this.setStartRecord(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(28, 4, data);
		this.setEndRecord(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(32, 4, data);
		this.setElectricity(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(36, 4, data);
		this.setSumMoney(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(40, 4, data);
		this.setStartCardMon(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(44, 4, data);
		this.setEndCardMon(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(48, 2, data);
		this.setserviceMon(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(50, 7, data);
		this.setLineNum(BytesUtil.bcdBytesToStr(temp));

		temp = BytesUtil.getByte(57, 1, data);
		this.setIsPay(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(58, 1, data);
		this.setStartCardMon(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(59, 1, data);
		this.setStartWay(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(60, 1, data);
		this.setControll(BytesUtil.bytesToIntSeq(temp));

		temp = BytesUtil.getByte(61, 4, data);
		this.setLimitData(BytesUtil.bytesToIntDesc(temp));

		temp = BytesUtil.getByte(65, 17, data);
		this.setIdentiNum(BytesUtil.stringToAscii(temp.toString()));
	}

	@Override
	public String toString() {
		return "BillContent [startTime=" + startTime + ", endTime=" + endTime + ", cardNum=" + cardNum
				+ ", startRecord=" + startRecord + ", endRecord=" + endRecord + ", electricity=" + electricity
				+ ", sumMoney=" + sumMoney + ", startCardMon=" + startCardMon + ", endCardMon=" + endCardMon
				+ ", serviceMon=" + serviceMon + ", isPay=" + isPay + "]";
	}

}
